package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.common.entity.Category;

import com.leyou.item.dto.CategoryDTO;
import com.leyou.item.mapper.CategoryMapper;
import com.leyou.item.service.CategoryService;

import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
    @Override
    public List<CategoryDTO> queryCategoryByPid(Long pid) {
        List<Category> list = query().eq("parent_id", pid).list();
        return CategoryDTO.convertEntityList(list);
    }
}